<%- include('layout/header.ejs')%>
  <div class="page">
    <div class="rowFluid">
      <div class="span12">
        <div class="main">
          <div class="z_banner news_banner"></div>
          <div class="news_search">
            <div class="serch_main">
              <input type="search" name="keyword" class="search_input" value="<%=searchValue%>" placeholder="请输入问题标题..." />
              <button type="button" class="search_btn">搜索</button>
            </div>
          </div>
          <div class="technical_support">
            <div class="rowFluid">
              <div class="span12">
                <div class="container">
                  <div class="technical_support_content">
                    <div class="span9 col-sm-12 ">
                      <div class="technical_support_list">
                        <div class="technical_support_box">
                          <div class="title">当前位置：<% crumbsData.forEach(item => { %><a href="<%=item.href?item.href:'javascript:;'%>"><%= item.name %></a><%=item.href?' > ':''%><% }) %></div>
                          <ul><% problemData.forEach(item => { %>
                            <li>
                              <a href="/cjwtxq/<%=item.id%>" title="<%= item.title %>" target="_blank">
                                <div class="right span12">
                                  <div class="right1"><strong style="color: #3d94f1;">问：</strong><%= item.title %></div>
                                  <div class="right2"><strong style="color: #F60;">答：</strong><%= item.answer %></div>
                                </div>
                              </a>
                            </li><% }) %>
                          </ul>
                          <div style="text-align: center;">
                            <div id="pager" class="pager clearfix" style="margin-bottom: 0;"></div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="span3 col-sm-12 ">
                      <div class="technical_support_list">
                        <div class="technical_support_box">
                          <div class="title" style="display: flex;align-items: center;justify-content: space-between;">
                            <strong style="color: #3d94f1;flex: 1;">新闻资讯</strong>
                            <a href="/xwzx" style="color: #999;font-size: 12px;">更多...</a>
                          </div>
                          <ul><% newsData.forEach(item => { %>
                            <li>
                              <a href="/xwzxxq/<%=item.id%>.html" title="<%= item.title %>" target="_blank">
                                <div class="text"><%= item.title %></div>
                              </a>
                            </li><% }) %>
                          </ul>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <script type="text/javascript">
            // 新闻资讯搜索
            let pathArr = location.pathname ? location.pathname.split('/') : []
            pathArr.forEach((item, index) => {
              itemArr = item ? item.split('-') : []
              itemArr.forEach((ite, ind) => {
                if (/^p\d+$/.test(ite)) {
                  itemArr.splice(ind, 1)
                  pathArr[index] = itemArr[0]
                }
              })
            })
            $('.search_btn').click(function() {
              $(this).attr('disabled', true)
              location.href = `${pathArr.join('/')}?keyword=${$('.search_input').val()}`
            })
            // 分页
            $("#pager").zPager({
              totalData: <%=problemDataTotal%>,
              current: <%=problemDataPageNum%>,
              pageData: <%=problemDataPageSize%>,
              htmlBox: $('#wraper'),
              btnShow: true,
              ajaxSetData: false
            });
            // 当前页出发
            function currentPage (num) {}
          </script>
          <%- include('layout/footer.ejs') %>